//
//  ActiveMissionCell.m
//  EnvironmentalProtection
//
//  Created by HCreater on 2018/11/5.
//  Copyright © 2018年 HCreater. All rights reserved.
//

#import "ActiveMissionCell.h"

@interface ActiveMissionCell ()

/// viewModle
@property (nonatomic, readwrite, strong) ActiveMissionCellModel *viewModel;

/// IBOutlet
@property (weak, nonatomic) IBOutlet UILabel* titleLabel;
@property (weak, nonatomic) IBOutlet UILabel* contentLabel;
@property (weak, nonatomic) IBOutlet UIButton* btn;

@end

@implementation ActiveMissionCell

- (void)awakeFromNib
{
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

#pragma mark - bind data
- (void)bindViewModel:(ActiveMissionCellModel *)viewModel
{
    self.viewModel = viewModel;
    
    @weakify(self);
    
    [[self rac_signalForSelector:@selector(layoutSubviews)] subscribeNext:^(id x) {
        
        @strongify(self);
        
        self.btn.layer.borderWidth = 2.0f;
        self.btn.layer.borderColor = Color_MainGreen.CGColor;
        self.btn.layer.cornerRadius = self.btn.frame.size.height/2.0f;
        self.btn.layer.masksToBounds = YES;
    }];
}

@end
